using UnityEngine;


public class TestAttackRange : MonoBehaviour
{
    public AttackRange TestAttackRangeValue;
    protected virtual void OnDrawGizmos()
    {
        if (Application.isPlaying) return;
        Gizmos.color = Color.red;

        var attackRange = TestAttackRangeValue;
        Vector3 center = (Vector3)attackRange.Offset;
        // 设置 Gizmos 的变换矩阵
        Matrix4x4 oldMatrix = Gizmos.matrix;
        Gizmos.matrix = Matrix4x4.TRS(center, Quaternion.Euler(0, 0, attackRange.rotation), Vector3.one);
        Gizmos.DrawWireCube(transform.position + (Vector3)attackRange.Offset, (Vector3)attackRange.Size);
        // 恢复原来的矩阵
        Gizmos.matrix = oldMatrix;
    }
}